define(function(require,exports,module){
	'use strict';
	
	var React = require('react');
	var $ = require('jquery');

	module.exports = React.createClass({
		handleSubmit:function(e){
			e.preventDefault();
			var username = React.findDOMNode(this.refs.username).value.trim();
			var email = React.findDOMNode(this.refs.email).value.trim();
			console.log({'client_id':client_id,'client_secret':client_secret,'redirect_uri':redirect_uri});
			$('#myModal').modal('hide');
		},
		render:function(){
			return (
				<div className="modal fade" id={this.props.id} tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
					<div className="modal-dialog">
				    	<div className="modal-content">
				      		<div className="modal-header">
				        		<button type="button" className="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				        		<h4 className="modal-title" id="myModalLabel">添加</h4>
				      		</div>
					  		<form onSubmit={this.handleSubmit}>
				      			<div className="modal-body">
						
						  			<div className="form-group">
									    <label for="username" className="control-label">用户名:</label>
									    <input type="text" className="form-control" ref="username" id="username" />
						  			</div>
								  	<div className="form-group">
									    <label for="email" className="control-label">邮箱:</label>
									    <input type="text" className="form-control" ref="email" id="email" />
								  	</div>
								  	<div className="form-group">
									    <label for="password" className="control-label">密码:</label>
									    <input type="password" className="form-control" ref="password" id="password" />
								  	</div>
								  	<div className="form-group">
									    <label for="rpassword" className="control-label">确认密码:</label>
									    <input type="password" className="form-control" ref="rpassword" id="rpassword" />
								  	</div>
					
						      	</div>
						      	<div className="modal-footer">
						        	<button type="button" className="btn btn-default" data-dismiss="modal">取消</button>
						        	<input type="submit" className="btn btn-primary" value="保存" />
						      	</div>
							</form>
				    	</div>
				  	</div>
				</div>
			);
		}
	});
	
});